using System;

namespace Aima.Core.util
{


    public class MockRandomizer : IRandomizer
    {
        private readonly double[] _values;
        private int _index;

        //  the set of predetermined random values to loop over.
        public MockRandomizer(double[] values)
        {
            _values = new double[values.Length];
            Array.Copy(values, 0, _values, 0, values.Length);
            _index = 0;
        }

        
        // START-Randomizer
        public double NextDouble()
        {
            if (_index == _values.Length)
            {
                _index = 0;
            }

            double value = _values[_index];
            _index++;
            return value;
        }

      
    }
}